<template>
  <div class="border border-gray-200 rounded-lg p-4 mb-4 relative">
    <button
      v-if="showRemove"
      @click="$emit('remove')"
      class="absolute top-2 right-2 bg-red-500 text-white border-none rounded px-2 py-1 text-xs cursor-pointer hover:bg-red-600 transition-colors"
    >
      删除
    </button>
    <slot />
  </div>
</template>

<script setup lang="ts">
interface Props {
  showRemove?: boolean
}

withDefaults(defineProps<Props>(), {
  showRemove: true
})

defineEmits<{
  remove: []
}>()
</script>
